package com.chaos.eurekaproducer.design.proxy;

import com.chaos.eurekaproducer.design.RealSubject;
import com.chaos.eurekaproducer.design.Subject;

/**
 * @author liaopeng
 * @title: JdkDynamicController
 * @projectName eureka-producer
 * @description: TODO
 * @date 2021/7/20下午2:58
 */
public class DynamicController {
    public static void main(String[] args) {
        //jdk动态代理测试
//        Subject proxy = new JdkDynamicProxy(new RealSubject()).getProxy();
//        proxy.print();

        //cglib动态代理测试
        RealSubject subject1 = new RealSubject();
        CglibProxy proxy = new CglibProxy();
        RealSubject subject = CglibProxyFactory.getInstance(proxy);
        System.out.println(subject);
        subject.print();

    }
}
